S2: Freer Arrows and Why You Need Them in Haskell

Seminar

Choreographic programming is a paradigm for writing distributed applications. It allows programmers to write a single program, called a choreography, that defines how the participants involved should work together. Through endoint projection, such a choreography can be translated into a separate program for each participant.

Arrow notation is a GHC extension that allows one to give meaning to DSLs of the form "(x,y,z) <- operation <- (a,b,c)" where a,b,c are input variables to some code and (x,y,z) are output variables, essentially a way to describe directed graphs. "Free" arrows are a way to interpret and combine multiple arrows.

A recent paper "Freer Arrows and Why You Need Them in Haskell", claims that freer arrows are useful for choreographic programming, which supposably enhance the static analyzability of the programs. As far as I know the previous paper (HasChor, MultiChor) used Free Monads and I would be interested if you could explain how or what would change if they used Free Arrows instead.

Goal

You could either start the paper beginning with arrows and move towards choreographic programming, or with choreographic programming and move towards arrows.

To figure out what arrow notation and free arrow are, you should write some Arrow notation programs. To figure out choreographic programming you could write simple HasChor or MultiChor program. Then, I would be interested if you could explain how or what would changed when using Freer Arrows for Choreographic Programming.

References

Arrows and Choreographies:

Arrows:

Choreographies: